<!--  -->
<template>
  <div>
      <van-nav-bar title="发表评价" left-text="返回" left-arrow />
        <div class="lpc">
            <div>
            
            <van-image  width="80px" height="80px" src="https://img01.yzcdn.cn/vant/cat.jpeg"/>
            </div>
            <div>
            <van-rate size="30px" v-model="value"  void-icon="star" void-color="#eee" />
            </div>
        </div>
        <div>
            
          <van-field
    v-model="message"
     rows="2"
     autosize
     
     type="textarea"
    
     placeholder="和大家一起分享这份美好吧~"
     show-word-limit/>  
<p>图片添加：</p>
        <van-uploader
              :max-size="10000000"
              :max-count="9"
              v-model="fileList"
              multiple />

        </div>

<van-button  type="primary " color="linear-gradient(to right, #ff6034, #ee0a24)" @click="pl" round block>提交评价</van-button>
  </div>
</template>

<script>
export default {
name : "publishcomments",
data() {
    return {
        value:0,
        message:'',
        fileList: [], //图片
      imgurl: "", //图片路径
      oneurl: "", //传给后台的图片类型
      imgs: "", //截图
    }
},
methods:{
    pl(){
    let did = this.$route.query.id //订单id
     let usid= this.$route.query.userId //用户id
      let gsid= this.$route.query.goodsId //商品id
     this.$axios.post('/api/marketComment/add?goodsId='+gsid+'&userId='+usid+'&commentContent='+this.message+'&commentScore='+this.value+'&orderId='+did).then((res)=>{
      console.log(res)
    })
    }
},


  }
</script>

<style  scoped>
.lpc{
    display: flex;
    justify-content:space-around;
    align-items:center;
    border-bottom: 1px solid #f2f2f2;
}

.lpc>div>.van-image{
    margin-bottom: 10px;
} 
.van-field{
    margin-top: 10px;
height: 200px;
border-bottom: solid 1px #f2f2f2;
}
.van-button{
    position: absolute;
    bottom: 20px;
}

</style>

